<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html">
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title></title>
</head>
<body erke-hide>
</body>
<script>
/**
 * @param {string} s
 * @return {boolean}
 */
var validPalindrome = function(s) {
    if(s==s.split('').reverse().join('')){
    	return true;
    };
    var aAron=false;
    var i=0;
    var j=s.length-1;
    while(i<j){
    	if(s[i]==s[j]){
    		i++;
    		j--;
    	}else{
    		aAron=true;
    		break;
    	};
    };
    if(aAron){
    	var arr1=s.split('');
   		var arr2=s.split('');
   		arr1.splice(i,1);
   		arr2.splice(j,1);
   		console.log(arr1.join('')==arr1.reverse().join('')||arr2.join('')==arr2.reverse().join(''));
    }else{
    	console.log(true);
    	return true;
    };
};
var res=new validPalindrome("abc");
</script>
</html>